package enit

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type DataResponse struct {
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
	Data    interface{} `json:"data"`
}

func ErrorResponse(c *gin.Context, msg, data interface{}) {
	c.JSON(http.StatusOK, DataResponse{
		Code:    500,
		Message: msg,
		Data:    data,
	})
}

func SuccessResponse(c *gin.Context, msg, data interface{}) {
	c.JSON(http.StatusOK, DataResponse{
		Code:    200,
		Message: msg,
		Data:    data,
	})
}
